001    package jgb.examples.eventhandlers;
002    
003    import java.util.EventObject;
004    import java.util.Map;
005    
006    /**
007     * @author Francois Beausoleil, <a href="mailto:fbos@users.sourceforge.net">fbos@users.sourceforge.net</a>
008     */
009    public class ExitEventHandler {
010        private int returnCode;
011    
012        public ExitEventHandler(int returnCode) {
013            this.returnCode = returnCode;
014        }
015    
016        public void handleEvent(Map context, EventObject eventObject) {
017            System.exit(returnCode);
018        }
019    }